package o;

import com.bumptech.glide.Registry.NoModelLoaderAvailableException;
import com.bumptech.glide.Registry.NoSourceEncoderAvailableException;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import o.vk.c;

final class tj<Transcode> {
    private Map<Class<?>, si<?>> ʻ;
    private boolean ʻॱ;
    private Class<?> ʼ;
    private int ʽ;
    private final List<sa> ˊ = new ArrayList();
    private boolean ˊॱ;
    private final List<c<?>> ˋ = new ArrayList();
    private sa ˋॱ;
    private int ˎ;
    private Object ˏ;
    private rl ˏॱ;
    private Class<Transcode> ͺ;
    private rh ॱ;
    private boolean ॱˊ;
    private tf ॱˎ;
    private sc ॱॱ;
    private boolean ॱᐝ;
    private d ᐝ;

    tj() {
    }

    <R> void ˏ(rh rhVar, Object obj, sa saVar, int i, int i2, tf tfVar, Class<?> cls, Class<R> cls2, rl rlVar, sc scVar, Map<Class<?>, si<?>> map, boolean z, boolean z2, d dVar) {
        this.ॱ = rhVar;
        this.ˏ = obj;
        this.ˋॱ = saVar;
        this.ˎ = i;
        this.ʽ = i2;
        this.ॱˎ = tfVar;
        this.ʼ = cls;
        this.ᐝ = dVar;
        this.ͺ = cls2;
        this.ˏॱ = rlVar;
        this.ॱॱ = scVar;
        this.ʻ = map;
        this.ॱᐝ = z;
        this.ʻॱ = z2;
    }

    void ˏ() {
        this.ॱ = null;
        this.ˏ = null;
        this.ˋॱ = null;
        this.ʼ = null;
        this.ͺ = null;
        this.ॱॱ = null;
        this.ˏॱ = null;
        this.ʻ = null;
        this.ॱˎ = null;
        this.ˋ.clear();
        this.ˊॱ = false;
        this.ˊ.clear();
        this.ॱˊ = false;
    }

    uj ˋ() {
        return this.ᐝ.getAttrName();
    }

    tf ॱ() {
        return this.ॱˎ;
    }

    rl ˎ() {
        return this.ˏॱ;
    }

    sc ˊ() {
        return this.ॱॱ;
    }

    sa ʼ() {
        return this.ˋॱ;
    }

    int ᐝ() {
        return this.ˎ;
    }

    int ʽ() {
        return this.ʽ;
    }

    ud ॱॱ() {
        return this.ॱ.ʻ();
    }

    Class<?> ʻ() {
        return this.ͺ;
    }

    Class<?> ˏॱ() {
        return this.ˏ.getClass();
    }

    List<Class<?>> ˊॱ() {
        return this.ॱ.ॱ().ॱ(this.ˏ.getClass(), this.ʼ, this.ͺ);
    }

    boolean ˊ(Class<?> cls) {
        return ॱ(cls) != null;
    }

    <Data> ts<Data, ?, Transcode> ॱ(Class<Data> cls) {
        return this.ॱ.ॱ().ˊ((Class) cls, this.ʼ, this.ͺ);
    }

    boolean ˋॱ() {
        return this.ʻॱ;
    }

    <Z> si<Z> ˋ(Class<Z> cls) {
        si<Z> siVar = (si) this.ʻ.get(cls);
        if (siVar == null) {
            for (Entry entry : this.ʻ.entrySet()) {
                if (((Class) entry.getKey()).isAssignableFrom(cls)) {
                    siVar = (si) entry.getValue();
                    break;
                }
            }
        }
        if (siVar != null) {
            return siVar;
        }
        if (!this.ʻ.isEmpty() || !this.ॱᐝ) {
            return wg.ˋ();
        }
        throw new IllegalArgumentException("Missing transformation for " + cls + ". If you wish to ignore unknown resource types, use the optional transformation methods.");
    }

    boolean ˎ(tx<?> txVar) {
        return this.ॱ.ॱ().ˋ((tx) txVar);
    }

    <Z> sd<Z> ˏ(tx<Z> txVar) {
        return this.ॱ.ॱ().ॱ((tx) txVar);
    }

    List<vk<File, ?>> ˎ(File file) throws NoModelLoaderAvailableException {
        return this.ॱ.ॱ().ˎ(file);
    }

    boolean ˏ(sa saVar) {
        List ॱˊ = ॱˊ();
        int size = ॱˊ.size();
        for (int i = 0; i < size; i++) {
            if (((c) ॱˊ.get(i)).ॱ.equals(saVar)) {
                return true;
            }
        }
        return false;
    }

    List<c<?>> ॱˊ() {
        if (!this.ˊॱ) {
            this.ˊॱ = true;
            this.ˋ.clear();
            List ˎ = this.ॱ.ॱ().ˎ(this.ˏ);
            int size = ˎ.size();
            for (int i = 0; i < size; i++) {
                c ˎ2 = ((vk) ˎ.get(i)).ˎ(this.ˏ, this.ˎ, this.ʽ, this.ॱॱ);
                if (ˎ2 != null) {
                    this.ˋ.add(ˎ2);
                }
            }
        }
        return this.ˋ;
    }

    List<sa> ͺ() {
        if (!this.ॱˊ) {
            this.ॱˊ = true;
            this.ˊ.clear();
            List ॱˊ = ॱˊ();
            int size = ॱˊ.size();
            for (int i = 0; i < size; i++) {
                c cVar = (c) ॱˊ.get(i);
                if (!this.ˊ.contains(cVar.ॱ)) {
                    this.ˊ.add(cVar.ॱ);
                }
                for (int i2 = 0; i2 < cVar.ˊ.size(); i2++) {
                    if (!this.ˊ.contains(cVar.ˊ.get(i2))) {
                        this.ˊ.add(cVar.ˊ.get(i2));
                    }
                }
            }
        }
        return this.ˊ;
    }

    <X> ry<X> ˊ(X x) throws NoSourceEncoderAvailableException {
        return this.ॱ.ॱ().ˋ((Object) x);
    }
}
